<template>
    <div id="zengpin" v-if="zenglists.length">
        <div class="zenga">赠品</div>
        <div class="zengb">
            <div><p>{{zenglist.productSkuName}}</p><span>×{{zenglist.quantity}}</span></div>
            <div class="zengba"><p>{{zenglist.description}}</p></div>
        </div>
        <div class="zengc">
            <van-icon name="arrow" size="24" color="#ccc" @click="zengbar()"/>
        </div>
    </div>
</template>
<script>
import http from '@/util/http'
import Vue from 'vue'
import { Icon } from 'vant'

Vue.use(Icon)
export default {
  data () {
    return {
      zenglist: {},
      zenglists: []
    }
  },
  props: ['zengids'],
  mounted () {
    http({
      url: `/heihei/api/promo/complimentary/get_complimentary_list?c=h5&s=20000&t=1605163638292&v=1.0&skuIds=${this.zengids}`
    }).then(res => {
      this.zenglist = res.data.data[0].complimentaryList[0]
      this.zenglists = res.data.data[0].complimentaryList
    })
  },
  methods: {
    zengbar () {
      console.log('1111')
    }
  }
}
</script>
<style lang="scss" scoped>
    #zengpin{
        border-top: 10px solid #CBCCCE;
        background: #fff;
        display: flex;
        height: 93px;
        padding: 15px;

        .zenga{
            line-height: 43px;
            width: 50px;
            color: #ea413c;
            font-size: 14px;
            margin-right: 20px;
        }
        .zengb{
            overflow: hidden;
            div{
                p{
                text-overflow: ellipsis;
                white-space: nowrap;
                width: 80%;
                overflow: hidden;
                color: #262626;
                line-height: 1.5;
                font-size: 14px;
                float: left;
                margin-right: 20px;
                span{
                    display: inline-block;
                    line-height: 1.5;
                    font-size: 14px;
                }
            }
            }
            .zengba{
                p{
                    color: #ccc;
                }
            }
        }
        .zengc{
            position: relative;
            padding-top:14px;
        }
    }
</style>
